from django.db import models


class Score(models.Model):
    css_score = models.IntegerField(verbose_name="分数")
    css_course = models.ForeignKey('courses.Course', on_delete=models.CASCADE, related_name="score_course",
                                   verbose_name="课程")
    css_student = models.ForeignKey('users.User', on_delete=models.CASCADE, related_name="score_student",
                                    verbose_name="学生")
    css_teacher = models.ForeignKey('users.User', on_delete=models.CASCADE, related_name="score_teacher",
                                    verbose_name="评分老师")

    def __str__(self):
        return self.css_student.css_name

    class Meta:
        verbose_name = "分数信息"
        verbose_name_plural = verbose_name
        db_table = 'score'
